package com.wave12.utility;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;

public class CookieUtil {
    public static String getCookie(HttpServletRequest request, String key){
        String value = "";
        Cookie ck[] = request.getCookies();
        for(int i = 0; i < ck.length; ++i){
            Cookie rec = ck[i];
            if (rec.getName().equals(key)){
                value = rec.getValue();
                break;
            }
        }
        return value;
    }
}
